package com.briup.ch07;

/**
 * @Author briup-adam
 * @Date 2023/10/10 上午8:42
 * @Description
 **/

public abstract class Shape {
    private String name;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public abstract double getArea();

    public Shape() {
    }

    public Shape(String name) {
        this.name = name;
    }

}
class Circle extends Shape{
    private int radius;

    public Circle(String name, int radius) {
        super(name);
        this.radius = radius;
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI*radius*radius;
    }
}

class  ShapeTest{
    public static void main(String[] args) {
//        new Shape();
        Shape c=new Circle("圆",5);
        System.out.println(c.getArea());
    }


}
